<template>
  <div id="app">
    <div class="nav-container">
      <router-link v-for="route in routes" :key="route.path" :to="route.path" class="nav-button">
        {{ route.name || route.path }}
      </router-link>
    </div>
    <router-view style="height: 100%; width: 100%"></router-view>
  </div>
</template>

<script>
import router from './router'

export default {
  name: 'App',
  router,
  data() {
    return {
      routes: [],
    }
  },
  created() {
    // 获取所有路由配置
    this.routes = router.options.routes.filter((route) => !route.hidden)
  },
}
</script>

<style>
html,
body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  height: 100%;
  width: 100%;
}
.business-map-content {
  flex: 1;
  position: relative;
}

#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-container {
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #e8e8e8;
}

.nav-button {
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s;
}

.nav-button:hover {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

.nav-button.router-link-active {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}
</style>
